3.1.46 \(\int \frac {-1+x^2}{1+x^2} \, dx\)

Optimal. Leaf size=6 \[ x-2 \tan ^{-1}(x) \]

________________________________________________________________________________________

Rubi [A]  time = 0.00, antiderivative size = 6, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {388, 203} \begin {gather*} x-2 \tan ^{-1}(x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(-1 + x^2)/(1 + x^2),x]

[Out]

x - 2*ArcTan[x]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 388

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*x*(a + b*x^n)^(p + 1))/(b*(n*
(p + 1) + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rubi steps

\begin {align*} \int \frac {-1+x^2}{1+x^2} \, dx &=x-2 \int \frac {1}{1+x^2} \, dx\\ &=x-2 \tan ^{-1}(x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 6, normalized size = 1.00 \begin {gather*} x-2 \tan ^{-1}(x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(-1 + x^2)/(1 + x^2),x]

[Out]

x - 2*ArcTan[x]

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {-1+x^2}{1+x^2} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(-1 + x^2)/(1 + x^2),x]

[Out]

IntegrateAlgebraic[(-1 + x^2)/(1 + x^2), x]

________________________________________________________________________________________

fricas [A]  time = 1.00, size = 6, normalized size = 1.00 \begin {gather*} x - 2 \, \arctan \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-1)/(x^2+1),x, algorithm="fricas")

[Out]

x - 2*arctan(x)

________________________________________________________________________________________

giac [A]  time = 0.46, size = 6, normalized size = 1.00 \begin {gather*} x - 2 \, \arctan \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-1)/(x^2+1),x, algorithm="giac")

[Out]

x - 2*arctan(x)

________________________________________________________________________________________

maple [A]  time = 0.00, size = 7, normalized size = 1.17 \begin {gather*} x -2 \arctan \relax (x ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2-1)/(x^2+1),x)

[Out]

x-2*arctan(x)

________________________________________________________________________________________

maxima [A]  time = 2.97, size = 6, normalized size = 1.00 \begin {gather*} x - 2 \, \arctan \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-1)/(x^2+1),x, algorithm="maxima")

[Out]

x - 2*arctan(x)

________________________________________________________________________________________

mupad [B]  time = 0.04, size = 6, normalized size = 1.00 \begin {gather*} x-2\,\mathrm {atan}\relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2 - 1)/(x^2 + 1),x)

[Out]

x - 2*atan(x)

________________________________________________________________________________________

sympy [A]  time = 0.15, size = 5, normalized size = 0.83 \begin {gather*} x - 2 \operatorname {atan}{\relax (x )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2-1)/(x**2+1),x)

[Out]

x - 2*atan(x)

________________________________________________________________________________________